package com.mingqijia.gassafety.shared.constant.warnStrategy;

import com.mingqijia.gassafety.shared.constant.AppealStateEnum;

public enum WarnStrategyIntervalEnum {

    FIVE_MINUTE("5_minute", 5, 300000L),
    TEN_MINUTE("10_minute", 10, 600000L),
    HAS_HANDLED("30_minute", 30, 1800000L),
    FINISHED("60_minute", 60,3600000L),
    UNCLOESED("120_minute", 120, 7200000L);

    /**
     * 编码
     */
    private String code;
    /**
     * 毫秒数
     */
    private Integer minute;
    /**
     * 毫秒数
     */
    private Long interval;

    WarnStrategyIntervalEnum(String code, Integer minute, Long interval) {
        this.code = code;
        this.minute = minute;
        this.interval = interval;
    }

    private static final WarnStrategyIntervalEnum[] VALUES = WarnStrategyIntervalEnum.values();

    public static WarnStrategyIntervalEnum matcher(String code) {
        for (WarnStrategyIntervalEnum ele : VALUES) {
            if (ele.code.equals(code)) {
                return ele;
            }
        }
        // code为 no正好为
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Long getInterval() {
        return interval;
    }

    public void setInterval(Long interval) {
        this.interval = interval;
    }

    public Integer getMinute() {
        return minute;
    }

    public void setMinute(Integer minute) {
        this.minute = minute;
    }
}
